package com.multithreading.chart2.threadLocalRandom;

import java.util.concurrent.ThreadLocalRandom;

/**
 * @author chenqb
 * @version 1.0
 * @description: TODO
 * @date 2021/9/19 10:20
 */
public class ThreadLocalRandomTest {
    public static void main(String[] args) {
        //获取当前线程的随机数生成器
        ThreadLocalRandom threadLocalRandom=ThreadLocalRandom.current();


        for (int i = 0; i < 10; i++) {
            System.out.println(threadLocalRandom.nextInt(5));
        }
    }

}
